<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/4/24/024
 * Time: 20:12
 */

namespace app\admin\validate;

class MemberLevelValidate extends \think\Validate
{

    const SCENE_ADD = 'create'; //添加
    const SCENE_EDIT= 'edit'; //添加
    const SCENE_DEL = 'del'; //添加


    protected $rule = [
        'id' => 'require|number',
        'title' => 'require|max:32',
        'image' => 'require|max:200',
        'balance' =>  'require|number',
        'gold' =>  'require|number',
    ];


    protected $message  = [
        'id.require' => 'ID不能为空',

    ];

    protected $scene  = [
       self::SCENE_ADD => ['title', 'image', 'balance', 'gold'],
       self::SCENE_EDIT => ['id', 'title', 'image', 'balance', 'gold'],
       self::SCENE_DEL => ['id'],
    ];

}